don't error if the key doesn't exist and value is null. #2766
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
Removing an attribute from a CRD will remove the type information for that resource. Removing an attribute from an existing resource will generate a null value in the diff. This null value is used to unset the attribute in Kubernetes, but if the attribute doesn't exist, Kubernetes will ignore it without error. When validating a schema, if the type information doesn't exist, but the value to insert is null, then we can safely skip the "Attribute not found in schema" error.
The following samples have been added to
TestMorphValueToType()object -> object (null): A null attribute which doesn't exist in the type is specified in the value.object -> object (deep null): A null attribute within a nested object which doesn't exist in the type is specified in the value.object -> object (aggregate null): A null attribute within a nested object which doesn't exist in the type is specified in the value. All valid attributes of the nested object are null.Acceptance tests
TestMorphValueToType()Summary from acceptance testing:
NOTE: the following tests were re-run on their own due to timeout during initial testing:
Output from functionality testing:
Release Note
Release note for CHANGELOG:
References
Fixes: #2126
Community Note